(function(){"use strict";BX.namespace("BX.Landing.MediaPlayer");const e=BX.Landing.Utils.addQueryParams;const t=BX.Landing.Utils.getQueryParams;BX.Landing.MediaPlayer.Youtube=function(e,t){BX.Landing.MediaPlayer.BasePlayer.apply(this,arguments);if(!BX.Landing.MediaPlayer.Youtube.isApiAdded){const e=document.createElement("script");e.src="https://www.youtube.com/iframe_api";const t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t);BX.Landing.MediaPlayer.Youtube.isApiAdded=true;window.onYouTubeIframeAPIReady=BX.Landing.MediaPlayer.Youtube.onApiReady;window.onPlayerReady=BX.Landing.MediaPlayer.Youtube.onPlayerReady}if(BX.Landing.MediaPlayer.Youtube.isApiLoaded()){this.init()}else{BX.Landing.MediaPlayer.Youtube.sheduldedPlayers.push(this)}};BX.Landing.MediaPlayer.Youtube.isApiLoaded=function(){return typeof YT!=="undefined"&&typeof YT.Player!=="undefined"};BX.Landing.MediaPlayer.Youtube.isApiAdded=false;BX.Landing.MediaPlayer.Youtube.sheduldedPlayers=[];BX.Landing.MediaPlayer.Youtube.onApiReady=function(){BX.Landing.MediaPlayer.Youtube.sheduldedPlayers.forEach((e=>{e.init()}))};BX.Landing.MediaPlayer.Youtube.prototype={constructor:BX.Landing.MediaPlayer.Youtube,__proto__:BX.Landing.MediaPlayer.BasePlayer.prototype,init:function(){let t=this.iframe.src;if(new RegExp("^//").test(t)){t=t.replace("//","https://")}if(new RegExp("^http://").test(t)){t=t.replace("http://","https://")}this.iframe.src=e(t,{enablejsapi:1,origin:window.location.protocol+"//"+window.location.host});this.player=new YT.Player(this.iframe,{events:{onReady:()=>{void(this.parameters.autoplay?this.play():this.pause());void(this.parameters.mute?this.mute():this.unMute());void(this.parameters.loop?this.setLoop(true):this.setLoop(false));this.onPlayerReady()}}})},play:function(){this.player.playVideo()},pause:function(){this.player.pauseVideo()},stop:function(){this.player.stopVideo()},setLoop:function(e){this.parameters.loop=e;if(!this.loopInited){this.loopInited=true;this.player.addEventListener("onStateChange",function(e){void(this.parameters.loop&&e.data===0&&this.play())}.bind(this))}},seekTo:function(e){this.player.seekTo(e)},mute:function(){this.player.mute()},unMute:function(){this.player.unMute()}}})();
//# sourceMappingURL=youtube_mediaplayer.map.js